package com.wondream.myframework.app.controller.web;

import com.alibaba.fastjson.JSON;
import com.wondream.myframework.app.service.SearchService;
import com.wondream.myframework.app.vo.base.OpRequest;
import com.wondream.myframework.app.vo.base.OpResponse;
import com.wondream.myframework.app.vo.req.SearchCommonReq;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/search")
public class SearchController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private SearchService searchService;

    @PostMapping("/doCommon")
    public OpResponse<List<Map<String, Object>>> doCommon(@RequestBody OpRequest<SearchCommonReq> req){
        return OpResponse.success(searchService.doCommon(req.getParams()));
    }
}
